home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / intrfc4.arc / GLOBALS.PAS next >
Pascal/Delphi Source File  |  1990-12-23  |  3KB  |  149 lines

  1. unit globals;
  2.  
  3. interface
  4.  
  5. type
  6.   header_ptr = ^header_rec;
  7.   header_rec = record
  8.     file_id: array[0..3] of char; { 0-3 }
  9.     i1,                           { 4-5 }
  10.     i2,                           { 6-7 }
  11.     ofs_this_unit,                { 8-9 }
  12.     ofs_hashtable,                { A-B }
  13.     i3,                           { C-D }
  14.     i4,                           { E-F }
  15.     ofs_srcfile,                  {10-11}
  16.     i5,                           {12-13}
  17.     sym_size,                     {14-15}
  18.     code_size,                    {16-17}
  19.     reloc_size,                   {18-19}
  20.     const_size,                   {1A-1B}
  21.     var_size                      {1C-1D}
  22.       :word;
  23.   end;
  24.  
  25.   obj_ptr = ^obj_rec;
  26.   obj_rec = record
  27.     next_obj: word;  { in case of a hash collision }
  28.     name: string;
  29.   end;
  30.  
  31.   list_ptr = ^list_rec;
  32.   list_rec = record
  33.     offset : word;
  34.     hash : word;
  35.     next : list_ptr;
  36.   end;
  37.  
  38.   type_def_ptr = ^type_def_rec;
  39.   type_def_rec = record
  40.     type_type : byte;
  41.     other_byte : byte;
  42.     size : word;
  43.     case integer of
  44.     1 : ( element_ofs,element_unit,index_ofs,index_unit: word );
  45.     2 : ( table_ofs : word;
  46.           rec_junk : array[4..8] of word
  47.         );
  48.   3,5 : ( base_ofs,base_unit:word );
  49. 10,13 : ( lower,upper : longint;
  50.           type_ofs,type_unit:word
  51.         );
  52.    -1 : ( who_knows : array[3..8] of word
  53.         );
  54.   end;
  55.  
  56.   type_info_ptr = ^type_info_rec;
  57.   type_info_rec = record
  58.     id:byte;
  59.     type_def_ofs,type_unit : word;
  60.   end;
  61.  
  62.   var_info_ptr = ^var_info_rec;
  63.   var_info_rec = record
  64.     id:byte;
  65.     c_or_v,offset,in_unit,type_def_ofs,type_unit : word;
  66.   end;
  67.  
  68.   func_info_ptr = ^func_info_rec;
  69.   func_info_rec = record
  70.     id:byte;
  71.     q1,type_def_ofs,type_unit,ofs1,ofs2,num_args : word;
  72.   end;
  73.  
  74.   const_info_ptr = ^const_info_rec;
  75.   const_info_rec = record
  76.     id:byte;
  77.     type_def_ofs,type_unit : word;
  78.     case integer of
  79.     0:  (intval:longint);
  80.     1:  (realval:real);
  81.     2:  (stringval:string);
  82.     3:  (extendval:extended);
  83.     end;
  84.  
  85.   arg_ptr = ^arg_rec;
  86.   arg_rec = record
  87.     type_def_ofs,type_unit : word;
  88.     var_or_val : byte;
  89.     name:string;
  90.   end;
  91.  
  92.   word_array_ptr = ^word_array;
  93.   word_array=array[0..32760] of word;
  94.   byte_array_ptr = ^byte_array;
  95.   byte_array=array[0..65520] of byte;
  96.  
  97.   unit_ptr = ^unit_rec;
  98.   unit_rec = record
  99.     id:byte;
  100.     unit_number : word;
  101.     q1 : word;
  102.   end;
  103.  
  104.   unit_list_ptr = ^unit_list_rec;
  105.   unit_list_rec = record
  106.     name : string;
  107.     buffer : byte_array_ptr;
  108.     obj_list : list_ptr;
  109.   end;
  110.  
  111.   hash_ptr = ^hash_rec;
  112.   hash_rec = record
  113.     byte_len : word;
  114.     table    : word_array;
  115.   end;
  116.  
  117. const
  118.   record_id   =  2;
  119.   pointer_id  =  6;
  120.   const_id = 81;
  121.   type_id     = 82;
  122.   var_id      = 83;
  123.   proc_id     = 84;
  124.   func_id     = 85;
  125.   sys_proc_id = 86;
  126.   sys_fn_id   = 87;
  127.   sys_port_id = 88;
  128.   sys_mem_id  = 89;
  129.   unit_id     = 90;
  130.   init_id     = 128;   { Just hope that these haven't already been taken! }
  131.   uses_id     = 129;
  132. var
  133.   buffer,tpl_buffer : byte_array_ptr;
  134.   tpl_size : word;
  135.   header : ^header_rec;
  136.   hash_table : hash_ptr;
  137.   unit_list : array[64..255] of unit_list_ptr;
  138.   obj_list : list_ptr;
  139.   unitname : string;
  140.   last_kind : byte;
  141.   f:file;
  142.   got_tpl : boolean;
  143.   just_tpl : pointer;
  144.   unit_size : word;
  145.   uses_path : string;
  146. implementation
  147. { just declarations! }
  148.  
  149. end.